package priv.yiyuan.example.design;

/**
 * 遥控器
 * <p>
 * 命令模式(调用者)
 *
 * @author YiYuan
 * @data 2025/8/20
 * @apoNote
 */
public class UniversalRemoteControl {

    private Command command;

    public void setCommand(Command command) {
        this.command = command;
    }

    public void pressButton() {
        if (command != null) {
            command.execute();
        }
    }

    public void pressUndo() {
        if (command != null) {
            command.undo();
        }
    }
}
